From: Colin Walters Date: Mon, 31 Jul 2017 14:48:57 +0000 (-0400) Subject: lib/curl: Only check individual request errors X-Git-Tag: archive/raspbian/2022.1-3+rpi1~1^2~4^2~33^2~54 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=6347c0fb8878ac2cf809caa74cdf7fef5a97b786;p=ostree.git lib/curl: Only check individual request errors It looks like `curl_multi_socket_action()` will return an error if *one* of the requests has an error, but we already check for that explicitly by iterating over each handle. In libcurl, the "easy" layer doesn't really make use of this return value. I did a bit of looking elsewhere; systemd does check it as a runtime error, not an assertion. librepo doesn't use the multi interface. Closes: https://github.com/ostreedev/ostree/issues/1035 Closes: #1038 Approved by: jlebon --- diff --git a/src/libostree/ostree-fetcher-curl.c b/src/libostree/ostree-fetcher-curl.c index ae8bea73..57118f9c 100644 --- a/src/libostree/ostree-fetcher-curl.c +++ b/src/libostree/ostree-fetcher-curl.c @@ -425,11 +425,9 @@ static gboolean timer_cb (gpointer data) { OstreeFetcher *fetcher = data; - CURLMcode rc; GSource *orig_src = fetcher->timer_event; - rc = curl_multi_socket_action (fetcher->multi, CURL_SOCKET_TIMEOUT, 0, &fetcher->curl_running); - g_assert (rc == CURLM_OK); + (void)curl_multi_socket_action (fetcher->multi, CURL_SOCKET_TIMEOUT, 0, &fetcher->curl_running); check_multi_info (fetcher); if (fetcher->timer_event == orig_src) fetcher->timer_event = NULL; @@ -460,15 +458,12 @@ static gboolean event_cb (int fd, GIOCondition condition, gpointer data) { OstreeFetcher *fetcher = data; - CURLMcode rc; int action = (condition & G_IO_IN ? CURL_CSELECT_IN : 0) | (condition & G_IO_OUT ? CURL_CSELECT_OUT : 0); - rc = curl_multi_socket_action (fetcher->multi, fd, action, &fetcher->curl_running); - g_assert (rc == CURLM_OK); - + (void)curl_multi_socket_action (fetcher->multi, fd, action, &fetcher->curl_running); check_multi_info (fetcher); if (fetcher->curl_running > 0) {